package com.ych.spring.controller;

import com.ych.spring.service.BookService;
import com.ych.spring.service.CheckOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * @author yangchenghao
 */
@Component
public class BookController {
    @Autowired
    private BookService bookService;
    @Autowired
    private CheckOutService checkOutService;

    public void buyBookById(Integer bookId, Integer userId) {
        bookService.buyBookById(bookId, userId);
    }

    public void CheckOut(Integer userId, Integer[] bookIds) {
        checkOutService.checkOut(userId, bookIds);
    }
}
